package com.thx.role.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.thx.user.model.User;

/**
 * @author balance
 *
 */
@Entity
@Table(name = "ORG_ROLE")
public class Role implements Serializable{


	private static final long serialVersionUID = 882862238228499321L;

	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "uuid")
	private String roleId;
	private String roleName;//角色名称
	private String roleCode;//角色代码
	private String roleType;//角色类型      系统固有："1"  自定义："0"

	@Column(name = "description_")
	private String description;//角色描述

	@Column(name = "status_")
	private String status;//状态    1：未删   0：已删

	@ManyToMany(mappedBy="roles")
	private Set<User> users = new HashSet<User>();//关联人员
	private Date createDate;//创建日期
	
	private String comId;//企业id

	@Column(name = "reserve_1")
	private String reserve1;

	@Column(name = "reserve_2")
	private String reserve2;

	@Column(name = "reserve_3")
	private String reserve3;

	@Column(name = "reserve_4")
	private String reserve4;

	@Column(name = "reserve_5")
	private String reserve5;

	public void addUsers(User user) {
		this.users.add(user);
	}

	/*set get method*/

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleCode() {
		return roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	public String getRoleType() {
		return roleType;
	}

	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getReserve1() {
		return reserve1;
	}

	public void setReserve1(String reserve1) {
		this.reserve1 = reserve1;
	}

	public String getReserve2() {
		return reserve2;
	}

	public void setReserve2(String reserve2) {
		this.reserve2 = reserve2;
	}

	public String getReserve3() {
		return reserve3;
	}

	public void setReserve3(String reserve3) {
		this.reserve3 = reserve3;
	}

	public String getReserve4() {
		return reserve4;
	}

	public void setReserve4(String reserve4) {
		this.reserve4 = reserve4;
	}

	public String getReserve5() {
		return reserve5;
	}

	public void setReserve5(String reserve5) {
		this.reserve5 = reserve5;
	}

	public String getComId() {
		return comId;
	}

	public void setComId(String comId) {
		this.comId = comId;
	}

}
